from sklearn.neighbors import KNeighborsClassifier

X = [[1, 5], [2, 4], [2.2, 5], [4, 1.5], [5, 1], [5, 2], [5, 3],
     [6, 2], [7.5, 4.5], [8.5, 4], [7.9, 5.1], [8.2, 5]]

y = [0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2]

knn = KNeighborsClassifier(n_neighbors=3)
knn.fit(X, y)

knn.predict([[4.8, 5.1]])

knn = KNeighborsClassifier(n_neighbors=9)
knn.fit(X, y)

knn.predict([[4.8, 5.1]])

knn.predict_proba([[4.8, 5.1]])
